﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};
	
	var auditData = Jxstar.findComboData('audit');
	var httypeData = Jxstar.findComboData('httype');
	var items = [{
		width:'97%',
		border:false,
		layout:'form',
		autoHeight:true,
		xtype:'container',
		style:'padding:5 10 5 10;',
		items:[{
			anchor:'100%',
			border:false,
			xtype:'container',
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				xtype:'container',
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textfield', fieldLabel:'合同编号', name:'sj_contract_app__contract_code', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'合同名称', name:'sj_contract_app__contract_name', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'textfield', fieldLabel:'项目名称', name:'sj_contract_app__project_name', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'textfield', fieldLabel:'项目负责人', name:'sj_contract_app__project_user', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'textfield', fieldLabel:'实施单位', name:'sj_contract_app__dept_name', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'textfield', fieldLabel:'合同对方单位', name:'sj_contract_app__provider_name', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'textfield', fieldLabel:'送审部门', name:'sj_contract_app__done_deptname', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'textfield', fieldLabel:'送审人员', name:'sj_contract_app__dept_user', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'datefield', fieldLabel:'审计日期', name:'sj_contract_app__check_date', format:'Y-m-d', anchor:'100%'},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'审定金额(万元)', name:'sj_contract_app__check_money', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%', maxLength:12},
					{xtype:'hidden', fieldLabel:'供应商ID', name:'sj_contract_app__provider_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'送审部门ID', name:'sj_contract_app__done_deptid', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'主键', name:'sj_contract_app__app_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'项目负责人电话', name:'sj_contract_app__project_phone', anchor:'100%'}
				]
			},{
				border:false,
				xtype:'container',
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'combo', fieldLabel:'记录状态', name:'sj_contract_app__audit_up', defaultval:'0',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: auditData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: auditData[0][0]},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'合同金额(万元)', name:'sj_contract_app__contract_money', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'textfield', fieldLabel:'项目批复文号', name:'sj_contract_app__check_fileno', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'立项批复金额(万元)', name:'sj_contract_app__project_money', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'textfield', fieldLabel:'项目编号', name:'sj_contract_app__project_code', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'combo', fieldLabel:'合同类型', name:'sj_contract_app__contract_type',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: httypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: httypeData[0][0]},
					{xtype:'datefield', fieldLabel:'送审日期', name:'sj_contract_app__app_date', format:'Y-m-d', anchor:'100%', readOnly:true},
					{xtype:'textfield', fieldLabel:'联系人电话', name:'sj_contract_app__dept_phone', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'textfield', fieldLabel:'审计人', name:'sj_contract_app__check_user', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'合同审计编号', name:'sj_contract_app__sj_code', anchor:'100%', maxLength:20},
					{xtype:'hidden', fieldLabel:'实施单位id', name:'sj_contract_app__dept_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'审计人id', name:'sj_contract_app__check_userid', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'项目ID', name:'sj_contract_app__project_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'合同ID', name:'sj_contract_app__contract_id', anchor:'100%'}
				]
			}
			]
		},{
			anchor:'100%',
			border:false,
			xtype:'container',
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				xtype:'container',
				columnWidth:0.99,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textarea', fieldLabel:'审计意见', name:'sj_contract_app__check_desc', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', width:'100%', height:72, maxLength:2000},
					{xtype:'textarea', fieldLabel:'价格依据', name:'sj_contract_app__price_memo', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', width:'100%', height:72, maxLength:200}
				]
			}
			]
		}]
	}];
	
	config.param = {
		items: items,
		funid: 'sj_contract_get'
	};

	
	config.eventcfg = {		//初始化页面数据		initOther : function() {			var myform = this.form;			var chkdate = myform.get("sj_contract_app__check_date");			if (chkdate == null || chkdate.length == 0) {				myform.set("sj_contract_app__check_date", JxDefault.getToday());			}						var username = myform.get("sj_contract_app__check_user");			if (username == null || username.length == 0) {				myform.set("sj_contract_app__check_user", JxDefault.getUserName());				myform.set("sj_contract_app__check_userid", JxDefault.getUserId());			}						var check_money = myform.get("sj_contract_app__check_money");			var contract_money = myform.get("sj_contract_app__contract_money");			if (check_money == null || check_money == '0') {				myform.set("sj_contract_app__check_money", contract_money);			}		}	};
	
	return new Jxstar.FormNode(config);
}